/*
 * Filename:    HcpmsPdfTableUtil.java
 * Copyright:   2014 中国平安保险（集团）股份有限公司 版权所有
 * Company:     平安科技养老险及健康险系统开发部
 * Create at:   2014-12-10
 */
package com.paic.mhis.hcpms.itextpdf.web.util;

import com.itextpdf.text.pdf.PdfPTable;

public class HcpmsPdfTableUtil {
	public static PdfPTable createTable(int cellLenth, int before, int percentage, int align) {
		PdfPTable table = new PdfPTable(cellLenth);
		table.setSpacingBefore(before);
		table.setWidthPercentage(percentage);
		table.setHorizontalAlignment(align);
		return table;
	}

	public static PdfPTable createTable(float[] widths, int before, int percentage, int align) {
		if (widths == null || widths.length <= 0) {
			widths = new float[] { 1 };
		}
		PdfPTable table = new PdfPTable(widths);
		table.setSpacingBefore(before);
		table.setWidthPercentage(percentage);
		table.setHorizontalAlignment(align);
		return table;
	}
}
